{template admin/head}

<body>
<script type="text/javascript">
var ajaxparam = {
		'url' : '{CONTROL_URL}?a={$action}'
};

function submitcheck()
{
	return true;
}

function saveinfo()
{
	if(!submitcheck())
	{
		return;
	}
	var url = '{SITE_URL}ajax/admin.php?m=saveZhanghao';
	
	var data = $('#savedata').serialize();
		
	var callback = function(data)
	{
		if(data.sign == -2)
		{
			window.location = data.url;
		}
		else
		{
			if(data.sign == 1)
			{
				//添加成功,返回列表页
				layer.alert(data.msg,function(){
					window.location = $('#gotoList').attr('href');
				});
			}
			else
			{
				if(data.msg)
				{
					layer.msg(data.msg);
				}
				else
				{
					layer.msg('操作失败');
				}
			}
		}
	};
	makeAjax('post',url,data,callback);
}


</script>
<div class="wrapper">
	<div class="crumbs"><a href="javascript:;">帐号管理</a> &gt;<a id="gotoList" href="{SITE_URL}admin.php?a=adminM">帐号列表</a> &gt; <span>{$pagetitle}</span> </div>
	<div class="container_tit clearfix mb20 ft14">
		
	<form id="savedata">
		<input type="hidden" name="id" value="{$admin[id]}" />
		<h2 class="form_tit">帐号信息  </h2>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">登录帐号：</label>
				<input type="text" id="loginname" name="loginname" value="{$admin[loginname]}" class="text w200" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">登录密码：</label>
				<input type="text" id="loginpwd" name="loginpwd" value="" class="text w200" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">姓名：</label>
				<input type="text" id="name" name="name" value="{$admin[nickname]}" class="text w200" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">手机号：</label>
				<input type="text" id="phone" name="phone" value="{$admin[phone]}" class="text w200" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">是否启用：</label>
				<input style="vertical-align: middle;" {if '1' == $admin[status]}checked{/if} class="checkbox" type="radio" name="status" value="1" /><span class="mr15">启用</span>
				<input style="vertical-align: middle;" {if '2' == $admin[status] || empty($admin[status])}checked{/if} class="checkbox" type="radio" name="status" value="2" /><span class="mr15">停用</span>
			</p>
		</div>
		{loop $list $k $v}
		{php $sonlist=$admin[permission][$k]}
        <table class="table">
	        <tr>
	        	<td style="width: 150px;">
	        		{$v[name]}
	        	</td>
	        	<td>
	        		<ul>
	        		{loop $v['list'] $k2 $v2}
	        			<li style="float:left;padding-right:10px ;">
	        			{if in_array($k2,$sonlist)}
	        				<input style="vertical-align: middle;" class="checkbox" type="checkbox" checked name="permission[$k][]" value="{$k2}" /><label for="resort_index">{$v2[name]}</label>
	        			{else}
	        				<input style="vertical-align: middle;" class="checkbox" type="checkbox" name="permission[$k][]" value="{$k2}" /><label for="resort_index">{$v2[name]}</label>
	        			{/if}
	        			</li>
	        		{/loop}
	        		</ul>
	        	</td>
	        </tr> 
        {/loop}
        </table>
        <div class="form_item clearfix">
			<p class="clearfix">
				<label class="name"></label>
			    <input type="button" class="btnblue" value="提交" onclick="saveinfo()" />
			</p>
		</div>
    </form>
    </div>
</div>
</body>
{template admin/foot}
